Life goes on, go go go ...
Previously, there was a reference to the standard library provided by Golang: NET Package
Go Language Learning Net package (the path to go) brief aftertaste net package
func Parseip
Func Parseip (s string) IP
Parseip
In PHP, how does one convert an IP address to a decimal number. In PHP, how do I convert an IP address to a decimal number? IP addresses are usually used in PHP, but these IP addresses are not in decimal format. In PHP, how does one convert an IP
In PHP, how do I convert an IP address to a decimal number? IP addresses are usually used in PHP, but these IP addresses are not in decimal format. In PHP, converting IP addresses to decimal numbers is a headache. the following two methods are
[Translation] IP subnet division
Original article title: IP subnetting made easy
Address: http://articles.techrepublic.com.com/5100-10878_11-6089187.html
IP network engineers need to have a solid understanding of how IP subnet division works.
The application IP address of the pure IP database is converted to decimal. The original code for copying an IP address in decimal format is as follows: $ ip $ _ SERVER [REMOTE_ADDR]; echo your IP address :. $ ip.br; $ ip_arrexplode (., $ ip); $ ip0;
It turns out that you need to turn IP into decimal.
Copy the Code code as follows:
$ip = $_server[' remote_addr ');echo ' Your IP: '. $ip. '';$ip _arr = Explode (".", $ip);$ip = 0;foreach ($ip _arr as $i = + $s) {$ip + = $s *pow (256,3-$i);}echo '
IP addresses are usually used in PHP, but these IP addresses are not in decimal format. In PHP, how can I convert an IP address to a decimal number? The following describes how to convert an IP address to a decimal number in PHP? IP addresses are
IP addresses are usually used in PHP, but these IP addresses are not in decimal format. In PHP, how can I convert an IP address to a decimal number? The following describes how to convert an IP address to a decimal number in PHP? IP addresses are
It turns out that you need to turn IP into decimal.
Copy the Code code as follows:
$ip = $_server[' remote_addr ');
echo ' Your IP: '. $ip. '
';
$ip _arr = Explode (".", $ip);
$ip = 0;
foreach ($ip _arr as $i = + $s) {
$ip + = $s *pow (256,3-$i);
}
How to convert IP addresses to decimal numbers in PHPWhat about it? IP addresses are usually used in PHP, but these IP addresses are not in decimal format. In PHP, converting IP addresses to decimal numbers is a headache. The following two methods
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.